package com.tencent.welink.api.account;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * Created by junchihe on 2020/6/4.
 */
public class FindRolePermissionList extends WelinkOpenApi {
    private static final Logger log = LogManager.getLogger(FindRolePermissionList.class);

    @Override
    public void displayResult(String result) {
        JSONObject jsonObject = JSON.parseObject(result);
        for (Map.Entry entry : jsonObject.entrySet()){
            log.info("key={}:value={}",entry.getKey(),entry.getValue());
        }
    }

    public FindRolePermissionList(){
        super("/common/permission/findRolePermissionList",true);
    }

    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes,true);
        FindRolePermissionList findRolePermissionList =   new FindRolePermissionList();
        Map<String,Object> map = findRolePermissionList.getExtendsPara();
        map.put("role_code","admin");
       // map.put("page",1);
        findRolePermissionList.DoHttp();
        CrontabUtil.shutdown();

    }
}
